<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div class="root">
        <h2>欢迎来到{{name}}学习</h2>
        <!-- <button v-on:click="showInfo">点我提示信息 </button> -->
        <button @click="showInfo1">点我提示信息 </button>
        <button @click="showInfo2($event,66)">点我提示信息 </button>
    </div>

    <script>
        Vue.config.productionTip = false;

       const vm = new Vue({
            el:'.root',
            data:{
                name:'尚硅谷',

            },
            methods:{
                showInfo1(event){
                    console.log(event.target.innerText);
                    // alert('同学你好')
                },
                showInfo2(event,number){
                    console.log(event,number);
                    // alert('同学你好')
                }
            }
        })
    </script>
</body>
</html>